package game.test;

import org.junit.runner.RunWith;

import junit.framework.TestSuite;
import org.junit.runners.Suite;



/**
 * This class will test all the testing classes.
 * It will setup the basics tests for the ChessGame, EightQueensGame and KnightsTourGame classes.
 * It also allow for other test classes to be added onto the test suite.
 * @author Caleb Chan
 * <pre>
 * - Created February 16, 2010
 * </pre>
 */
@RunWith(Suite.class)
@Suite.SuiteClasses( { ChessGameTest.class, EightQueensGameTest.class, KnightsTourGameTest.class })
public class ChessGamesTestSuite extends TestSuite {

	/**
	 * Creates a test suite to test all test classes
	 * <pre>
	 * Caleb Chan
	 * - Created February 16, 2010
	 * </pre>
	 */
	public ChessGamesTestSuite(){
		//initializeBasicTests();
		this.addTestSuite(EightQueensGameTest.class);
		this.addTestSuite(ChessGameTest.class);
		this.addTestSuite(KnightsTourGameTest.class);
		//junit.textui.TestRunner.run(this);
	}
	/**
	 * Initializes the test suite with the ChessGame, EightQueensGame and KnightsTourGame classes 
	 * for testing.
	 * <pre>
	 * Caleb Chan
	 * - Created February 16, 2010
	 * </pre>
	 */
	public void initializeBasicTests(){
		this.addTestSuite(EightQueensGameTest.class);
		this.addTestSuite(ChessGameTest.class);
		this.addTestSuite(KnightsTourGameTest.class);
	}

	/**
	 * Runs through the list of classes and test each one individually
	 * <pre>
	 * Caleb Chan
	 * - Created February 16, 2010
	 * </pre>
	 */
	public void runTest(){
		junit.textui.TestRunner.run(this);
	}
	/**
	 * The main class
	 * @param args Parameters for running from command line
	 * <pre>
	 * Caleb Chan
	 * - Created February 16, 2010
	 * </pre>
	 */
	public static void main(String args[]){
		ChessGamesTestSuite testSuite = new ChessGamesTestSuite();
		testSuite.initializeBasicTests();
		testSuite.runTest();
	}
}
